package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("hanku.jpg");
        FileOutputStream fos = new FileOutputStream("hanku_cp.jpg");
        int d;
        byte[] data = new byte[1024*10];
        long sta = System.currentTimeMillis();
        while ((d = fis.read(data)) != -1){
            fos.write(data,0,d);
        }
        fis.close();
        fos.close();
        long end = System.currentTimeMillis();
        System.out.println("复制完成消耗时间+" +(end - sta));
    }
}
